@extends('layouts.master')

@section('content')

    <div class="col-sm-8 blog-main">
        @foreach($posts as $post)
            <div class="blog-post">
                <h2 class="blog-post-title">
                    <a href="{{action('PostsController@show',[$post->id])}}">{{$post->title}}</a>
                </h2>
                <p class="blog-post-meta">{{$post->created_at->toFormattedDateString()}} by <a href="/about">{{$post->user->name}}</a></p>
                <p>{{ str_limit($post->body,20) }}</p>
            </div><!-- /.blog-post -->
        @endforeach

        <nav class="blog-pagination">
            <a class="btn btn-outline-primary" href="#">Older</a>
            <a class="btn btn-outline-secondary disabled" href="#">Newer</a>
        </nav>
    </div>

@stop